<div class="container">
  <h2 class="main_title">Manage Orders</h2>
  <div class="def_width_100 f_left"> 
    
    <!--*************matter main************************-->
  <?php echo $form->create('Seller', array('action'=>'','method'=>'post','class' => 'mws-form')); ?>
        <div class="paging_gray">
          <div class="pag_ser_div">
                <select id="_myoLO_SearchTypeSelect" name="searchType">
                    <option value="ASIN">
                    Wsin
                    </option>
                    <option value="BuyerEmail">
                    Buyer Email
                    </option>
                    <option value="ListingID">
                    Listing ID
                    </option>
                    <option value="MerchantSKU">
                    Your Merchant SKU
                    </option>
                    <option value="OrderID">
                    Order ID
                    </option>
                    <option value="ProductName">
                    Product Name
                    </option>
                    <option value="FulfilledBy">
                    Fulfilled By
                    </option>
                    <option value="OrderStatus">
                    Order status
                    </option>
                    <option selected="" value="DateRange">
                    Date Range
                    </option>
                </select>    
                 </div>
          <div class="pag_ser_div">
            <select  class="select_count1" id="DateFilter" name="data[Orders][Filter]">
              <option value="3_d">Last 3 days</option>
              <option value="7_d" selected="selected">Last 7 days</option>
              <option value="14_d">Last 14 days</option>
              <option value="30_d" >Last 7 days</option>
              <option value="90_d">Last 90 days</option>
              <option value="180_d">Last 180 days</option>
              <option value="1_Y">Last 1 Year</option>
              <option value="2_Y">Year 2 Year</option>
            </select>
          </div>
          <div class="pag_ser_div1">
            <input name="" type="submit" value="Search" class="form_btn_2">
          </div>
         <!-- <div class="pag_ser_div"> <a href="#" >Advance Search</a> </div>-->
        </div>
    <?php
	echo $form->end(); 
	?>
    <div class="def_width_100 f_left"><span class="text_def_13 f_right">Total unshipped: <?php echo $UnshippedOrdersCount; ?> orders |
     Seller fulfilled pending:  <?php echo $UnshippedOrdersCount; ?>  orders</span></div>
    <div class="def_width_100 f_left">
      <h3 class="mid_title">All orders placed in the last 7 day(s)</h3>
      <div class="def_width_100 f_left"><span class="text_def_13 f_left">Orders 1 to 1</span></div>
      <div class="sell_order_mana">
        <?php
	  	if(isset($Order_list) and ($Order_list))
			{
			
	  ?>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="grid_table_list text_def_11">
          <thead>
            <tr>
              <th width="2%"><input name="" type="checkbox" value=""></th>
              <th width="7%">Order Date</th>
              <th width="8%">Sales Channel</th>
              <th width="10%">Fulfillment Channel</th>
              <th width="28%">Order ID/Product Details</th>
              <th width="10%">Contact Buyer</th>
              <th width="5%">Billing Country</th>
              <th width="9%">Shipping Service</th>
              <th width="5%">Status</th>
              <th width="8%">Estimated Delivery</th>
              <th width="10%">Action</th>
            </tr>
          </thead>
          <tbody>
            <?php
				  		foreach($Order_list as $Order)
							{
					  ?>
            <tr>
              <td  width="2%"><input name="" type="checkbox" value="<?php echo $Order['OrderItem']['id']; ?>"></td>
              <td width="7%"><?php echo$Order['OrderItem']['created']; ?></td>
              <td width="8%"><a href="<?php echo $website_url; ?>">Wondere.com</a></td>
              <td width="10%">Seller(<?php echo $this->Session->read('Auth.User.name'); ?>)</td>
              <td width="28%" class="text_def_13" style="text-align:left;"><br />
                <b style="float:left;">Order ID:</b> 
			    <?php 
					echo $html->link($Order['OrderItem']['order_tracking_id'], 
					array('action'=>'seller_order_detail',$Order['OrderItem']['order_tracking_id'], $Order['OrderItem']['order_Item_Id']),
					array('class'=>'brown_link f_left','target'=>'_blank'));?>
                    
                 <br />
                     <b> 
					<?php echo $html->link($Order['Product']['name'],
					array('controller'=>'products','action'=>'product',
					$Order['Product']['slug']),array('class'=>'blue','target'=>'_blank'));
			   ?>
               </b>
               <br/>
                <span> <b>QTY:</b><?php echo $Order['OrderItem']['qty']; ?> <br/>
                <b>WSIN:</b><?php echo $Order['Product']['wisn']; ?> <br/>
                <b>SKU:</b> <?php echo $Order['Product']['MasterProduct']['sku']; ?><br/>
                </span></td>
              <td width="10%"><?php echo $html->link($Order['Order']['User']['name'],
						  array('action'=>'seller_do_mail',$Order['Order']['User']['hash'], $Order['Order']['Order']['tracking_id']),array('class'=>''));?></td>
              <td width="5%"><?php echo $Order['Order']['Address']['CountryName']; ?></td>
              <td width="9%">Standard </td>
              <td width="5%">
              <?php
					if(isset($Order['OrderItem']['shipped']) and $Order['OrderItem']['shipped']==1)
						{
							echo "Shipped"; 
						}
					else
						{
						  echo "Unshipped"; 	
						}
			  ?>
              
             </td>
              <td width="8%">
              <?php
				  if(isset($Order['OrderItem']['shipped']) and $Order['OrderItem']['shipped']==1)
						{
							echo "Shipped:- ".$Order['OrderItem']['shipping_start_date']; 
							echo "<br>";
							echo "Deliverd:- ".$Order['OrderItem']['shipping_end_date']; 
						}
					else
						{
						  echo ""; 	
						}
			  ?>
             </td>
             <td>
               <?php echo $html->link('Edit Shippments', array('action'=>'edit_shipment', 'order_id'=>$Order['Order']['Order']['tracking_id'], 'order_item'=>$Order['OrderItem']['order_Item_Id']), array('class'=>'blk_link')); ?>
               
                <a href="#" class="blue_link">Refund Order</a>
             </td>
            </tr>
            <?php
							}
					?>
          </tbody>
        </table>
        <?php
			}
		?>
      </div>
    </div>
    <div class="pad_10"></div>
    
  </div>
</div>
